package com.zsy.dao;

import com.zsy.pojo.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrdersDao {

    @Insert("insert into orders values(#{id},#{number},#{status},#{userId},#{addressBookId},#{orderTime},#{checkoutTime},#{payMethod},#{amount},#{remark},#{phone},#{address},#{userName},#{consignee})")
    void save(Order order);


    List<Order> select(@Param("number") Long number, @Param("beginTime") String beginTime, @Param("endTime") String endTime);

    @Select("select * from orders where User_id=#{userId}")
    List<Order> pageUser(Long userId);

}
